import { Injectable } from '@angular/core';
import { LeanCloudService } from 'app/utils/lean-cloud.service'
import { Observable } from 'rxjs'
import { PageService } from 'app/utils/page.service'

@Injectable()
export class TaskManageService {

  constructor(
    private leanCloudService: LeanCloudService
  ) { }

  async getUserTaskInfo() {
    let user = await this.leanCloudService.Query('user').equalTo('auth',this.leanCloudService.User.current()).first()
    return this.leanCloudService.send(({ leancloud }) => {
      let query_user = leancloud.Query('task')
      query_user.equalTo('user', user)
      // console.log(query_user.find())

      return query_user.find().then((data) => {
        console.log(data)
      })
    })
  }

  getUserTasks() {

  }

  getProjectTasks() {

  }
}
